package com.jy.api.payRes;

import com.jy.api.domain.*;
import com.jy.api.enums.OrderPayChannel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Table(name = "order_201912")
@Slf4j
@Entity
@Data
public class Order201912  {
    @Id
    @Column(length = 50)
    private String id;
    private String storeId;
    private String memberId;
    private String memberName;
    private String creatorId;
    private String creatorName;
    private String code;
    private double total = 0;
    private int count = 0;
    private double discount = 0;
    private double amount = 0;
    @Enumerated(EnumType.STRING)
    private OrderStatus status;
    @Enumerated(EnumType.STRING)
    private OrderSource source;
    @Enumerated(EnumType.STRING)
    private OrderType type;
    private Date createTime;

    private double removeZero;


    /**
     * 退单时间
     *
     * @deprecated 退单会生成新的订单记录，不允许修改已有订单
     */
    @Temporal(TemporalType.TIMESTAMP)
    private Date refundTime;
    /**
     * 座位号
     */
    private String tableNo;
    private Date addTime;
    private Date updateTime;
    private boolean enabled = true;
    /**
     * 固定提成金额
     */
    private double commission = 0;

    /**
     * 支付ID
     */
    private String payId;
    /**
     * 支付时间
     */
    private Date paymentTime;
    /**
     * 支付渠道
     */
    private String channel;

    /**
     * 商品出入库状态
     */
    private boolean stock = false;

    /**
     * 备注
     */
    private String notes;


    /**
     * 退单原因
     */
    private String refundReason;

    /**
     * 关联订单id。比如退单的原始订单id
     */
    private String refOrderId;


}
